{extend name="layout/layout" /}

{block name="pagecss"}
<style>
    .district {
        cursor: pointer;
    }
</style>
{/block}

{block name="content"}
<div class="row js-check-wrap">
    <div class="col-md-12">
        <div class="advanced-search">
            <div class="portlet box green" id="advancedSearch" data-model="agent">
                <div class="portlet-title">
                    <div class="caption">
                        <i class="fa fa-search"></i> 高级搜索 </div>
                    <div class="tools">
                        <a href="javascript:;" class="expand" title="展开/收缩"> </a>
                    </div>
                </div>
                <div class="portlet-body form" style="display: none;">
                    <!-- BEGIN FORM-->
                    <form id="search" action="" class="form-horizontal">
                        <div class="form-body">
                            <!--<h3 class="form-section"></h3>-->
                            <div class="row">
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <label class="control-label col-md-3">商户编号</label>
                                        <div class="col-md-9">
                                            <input type="text" class="form-control" name="code" value="">
                                        </div>
                                    </div>
                                </div>
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <label class="control-label col-md-3">商户名称</label>
                                        <div class="col-md-9">
                                            <input type="text" class="form-control" name="name" value="">
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <label class="control-label col-md-3">经营类目</label>
                                        <div class="col-md-9">
                                            <select class="form-control select2-multiple" name="category" multiple>
                                                <!--<option value="">所有</option>-->
                                                {foreach name="industryCate" item="industry" key="industryKey"}
                                                <option value="{$industry.name}">{$industry.name}</option>
                                                {/foreach}
                                            </select>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <label class="control-label col-md-3">所在地区</label>
                                        <div class="col-md-9">
                                            <!--<select class="form-control select2-multiple" name="district" multiple>
                                                <optgroup label="湖北">
                                                    <option value="武汉">武汉</option>
                                                    <option value="黄石">黄石</option>
                                                    <option value="宜昌">宜昌</option>
                                                </optgroup>
                                                <optgroup label="湖南">
                                                    <option value="长沙">长沙</option>
                                                    <option value="岳阳">岳阳</option>
                                                </optgroup>
                                            </select>-->
                                            <input type="text" class="form-control district" name="district" value="" readonly>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <!--<div class="row">
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <label class="control-label col-md-3">账号</label>
                                        <div class="col-md-9">
                                            <input type="text" class="form-control" name="loginName" value="">
                                        </div>
                                    </div>
                                </div>
                            </div>-->
                        </div>
                        <div class="form-actions">
                            <div class="row">
                                <div class="col-md-6">
                                    <div class="row">
                                        <div class="col-md-offset-3 col-md-9">
                                            <button type="button" class="btn green" id="doSearch">搜索</button>
                                            <button type="reset" class="btn default">清空</button>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-md-6"> </div>
                            </div>
                        </div>
                    </form>
                    <!-- END FORM-->
                </div>
            </div>
        </div>

        <div class="portlet light">
            <div class="box-header">
                <div class="row">
                    <div class="col-md-9 col-sm-12">
                    </div>
                    <div class="col-md-3 col-sm-12">
                        <div class="pull-right">
                            <a href="{:url('agent/tenant/add')}" class="btn blue btn-circle"><i class="fa fa-plus"></i> 开通商户</a>
                        </div>
                    </div>
                </div>
            </div>
            <div class="portlet-body">
                <form class="js-ajax-form" method="post">
                    <div class="">
                        <table id="data-table" class="table table-bordered table-hover dataTable">
                            <thead>
                            <th>商户编号</th>
                            <th>商户名称</th>
                            <th>行业类目</th>
                            <th>所在地</th>
                            <th>账号</th>
                            <th>所属代理商</th>
                            <th>操作</th>
                            </thead>
                        </table>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>

<!-- 详情 模态框 -->
<div class="modal fade" id="detail-modal" data-backdrop="static" data-keyboard="false" >
    <div class="modal-dialog" style="width:800px; height: 520px;">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">x</button>
                <h4 class="modal-title">详情</h4>
            </div>
            <div class="modal-body">

            </div>
            <div class="modal-footer">
                <button type="button" class="btn default" data-dismiss="modal">关闭</button>
            </div>
        </div>
    </div>
</div>

<input type="hidden" class="datalist_url" value="{:url('agent/tenant/ajaxTenantList')}">
<input type="hidden" class="view_url" value="{:url('agent/tenant/view')}">
<input type="hidden" class="renewalFee_url" value="{:url('agent/tenant/renewalfee')}">
<input type="hidden" class="enable_url" value="{:url('agent/tenant/enable')}">
<input type="hidden" class="disable_url" value="{:url('agent/tenant/disable')}">
<input type="hidden" class="edit_url" value="{:url('agent/tenant/edit')}">
<input type="hidden" class="district_url" value="{:url('agent/region/getDistrict')}">
{/block}

{block name="pagescript"}
<script src="__STATIC__/agent/pages/js/tenant.js" type="text/javascript"></script>
{/block}